package com.itheima.homework02;

public class StringHandlerDemo {
    public static void main(String[] args) {
        useStringHandler(new StringHandler() {
            @Override
            public void printMessage(String str) {
                System.out.println(str);
            }
        });
        //lambda表达式,进行简化
        useStringHandler(str -> System.out.println(str));

    }

    private static void useStringHandler(StringHandler stringHandler) {
        stringHandler.printMessage("打印信息");
    }
}

